package moodish.client.tests;

import static org.junit.Assert.*;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import moodish.client.MoodishClientStarter;
import moodish.client.gui.MoodishClientGui;
import moodish.comm.ClientComm;
import moodish.comm.ClientInterface;

public class ClientTester {
	
	
	MoodishClientStarter starter;
	ClientComm comm;
	
	@Before
	public void setUPClass(){
		starter = new MoodishClientStarter();
		comm = new ClientInterface();
		assertNotNull(starter);
		assertNotNull(comm);
	}
	
	@Test
	public void test() {
		starter.start(new ClientInterface());
		MoodishClientGui gui = starter.getGui();
		assertNotNull(gui);
		Assert.assertTrue(gui.getFrame().isVisible());
		ClientComm guiComm = gui.getComm();
		assertNotNull(guiComm);
		
		Assert.assertTrue(gui.getFrame().getWidth() == MoodishClientGui.WINDOW_WIDTH);
		Assert.assertTrue(gui.getFrame().getHeight() == MoodishClientGui.WINDOW_HEIGHT);
		
	}
}
